package mse.eai.jbpm.dailyDigestProcess;

import java.util.Map;
import java.util.Map.Entry;

import org.jboss.logging.Logger;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;

public class PrintRequest implements ActionHandler {

	private static final Logger log = Logger.getLogger(PrintRequest.class);

	@Override
	public void execute(ExecutionContext context) throws Exception {

		log.info("Executing ---------->");

		Map<Integer, String> mapOfEmails = (Map<Integer, String>) context
				.getVariable("MapOfEmails");

		//log.info("Got from context: " + "mapOfEmails  = " + mapOfEmails);
		
		/*
		for (Entry<Integer, String> entry : mapOfEmails.entrySet()) {

			log.info("EMAIL ADDRESS: " + entry.getKey());
			log.info("EMAIL TEXT: " + entry.getValue());

		}
		 */
		
		log.info("<--------------- Done");

		context.leaveNode();

	}

}
